//
//  SettingViewController.m
//  PureProject
//
//  Created by Tung Tran on 4/22/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "SettingViewController.h"

@interface SettingViewController ()


@end

@implementation SettingViewController
@synthesize settingTalbeView = _settingTalbeView;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    
    // Set title
    self.title = @"Setting";
    
    // Set not Did select row
    [self.settingTalbeView setAllowsSelection:NO];
    
    // Add home item
    UIBarButtonItem *homeItem = [[UIBarButtonItem alloc] initWithTitle:@"Home" style:UIBarButtonItemStyleBordered target:self action:@selector(itemHomeIsPressed:)];
    self.navigationItem.leftBarButtonItem = homeItem;
    [homeItem release];
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
	return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}

#pragma mark - TableView datasource
// Number section
- (NSInteger) numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

//Number row in section

- (NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 1;
}

// Cell for row at index patch 

- (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";
    
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
    }
    //Configure Cell
    
    cell.textLabel.text = @"Project Name"; // set textLabel
    // add 
    UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(145, 9,  cell.bounds.size.width,cell.bounds.size.height)]; 
    textField.font = [UIFont systemFontOfSize:23.0];
    [cell.contentView addSubview:textField];
    [textField release];
    

    return  cell;
}

#pragma mark - Item Navigation Bar
- (void)itemHomeIsPressed:(id)sender
{
    [self dismissModalViewControllerAnimated:YES];
}

@end
